"""
Get sample list from data directory
"""

import os


def get_samples(folder_path: str, suffix_len: int) -> list:
    """get sample list from data directory

    Args:
        folder_path (str): directory path
        suffix_len (int): suffix length
    Returns:
        list: sample list in directory path
    """
    name_map = {}
    for name in os.listdir(folder_path):
        if (name[-5:] == "fq.gz") and (name[0] != "."):
            k = name[:-suffix_len]
            if k in name_map:
                name_map[k].append(name)
            else:
                name_map[k] = [name]

    filter_name_map = {key: value for key, value in name_map.items() if len(value) == 2}
    return filter_name_map
